home *** CD-ROM | disk | FTP | other *** search
/ Commodore Disk User Volume 3 #5 / Commodore_Disk_User_Vol.3_5_1990_-.d64 / joystick tester (.txt) < prev    next >
Commodore BASIC  |  2022-10-26  |  14KB  |  81 lines

  1. 0 poke774,248:poke775,252:poke808,234:gosub650
  2. 1 poke53280,0:poke53281,0:printchr$(147)
  3. 2 joy=56320:a=2:j$="neutral":vl$="00":b$="off"
  4. 5 print" joystick tester by michael smith @1989 [146]"
  5. 12 print"     [209]     ":print
  6. 13 print" [209]       [209]  ":print:print
  7. 15 print"[209]    [209]    [209]  ":print
  8. 16 print"           "
  9. 17 print" [209]       [209]  ":print
  10. 18 print"     [209]     "
  11. 20 print"joystick port     :";a"[146]"
  12. 21 print"joystick direction:";j$"[146]"
  13. 22 print"value:";vl$"[146]"
  14. 23 print"joystick button   :";b$;"[146]"
  15. 24 print"h - help[146]"
  16. 25 print"      press space to change port      [146]"
  17. 50 fork=0to10
  18. 51 gosub100
  19. 55 geta$:ifa$=""then56
  20. 56 ifa$=" "thengoto150
  21. 57 ifa$="h"then550:end
  22. 67 ifjv=0then98
  23. 68 ifjv=1thenj$="up         ":vl$="01":goto507
  24. 69 ifjv=2thenj$="down       ":vl$="02":goto506
  25. 70 ifjv=4thenj$="left       ":vl$="04":goto505
  26. 71 ifjv=5thenj$="up/left    ":vl$="05":goto504
  27. 72 ifjv=6thenj$="down/left  ":vl$="06":goto503
  28. 73 ifjv=8thenj$="right      ":vl$="08":goto502
  29. 74 ifjv=9thenj$="up/right   ":vl$="09":goto501
  30. 95 ifjv=10thenj$="down/right ":vl$="10":goto500
  31. 98 iffr=16thenb$="off":j$="neutral    ":vl$="00":goto510
  32. 99 b$="on ":goto23
  33. 100 jv=peek(joy)
  34. 110 fr=jvand16
  35. 120 jv=15-(jvand15)
  36. 130 return
  37. 140 end
  38. 150 ifa=2thenjoy=56321:a=1:goto12
  39. 155 ifa=1thenjoy=56320:a=2:goto12
  40. 160 end
  41. 500 print"[153] [209][150]       [209]  ":goto12
  42. 501 print" [209][150]       [209]  ":goto12
  43. 502 print"[209]    [209][150]    [209]  ":goto12
  44. 503 print"[150] [209]       [209]  ":goto12
  45. 504 print"[150] [209]       [209]  ":goto12
  46. 505 print"[150][209]    [209]    [209]  ":goto12
  47. 506 print"[150]     [209]     ":goto12
  48. 507 print"[150]     [209]     ":goto12
  49. 510 print"[209]   [150] [209]    [209]  ":goto12
  50. 520 end
  51. 550 rem *** instructions ***
  52. 551 print"[147]"
  53. 555 printchr$(147)
  54. 556 print" joystick tester by michael smith @1989 [146]"
  55. 560 print"instructions:"
  56. 561 print:print"joystick tester allows you to test your"
  57. 562 print"joystick(s) to see if they function"
  58. 563 print"correctly."
  59. 565 print"joystick port [146] - the port the program"
  60. 566 print"is testing the joystick"
  61. 567 print"joy. direction[146] - the direction you are"
  62. 568 print"pushing the joystick"
  63. 569 print"value         [146] - the computers value"
  64. 570 print"of the direction"
  65. 575 print"joy. button   [146] - shows if the fire"
  66. 576 print"button has been pressed"
  67. 577 print"red lights    [146] - shows the current"
  68. 578 print"direction of the stick"
  69. 580 print"         press space to exit          [146]"
  70. 600 geta$:ifa$<>" "then600
  71. 601 printchr$(147):goto5:end
  72. 650 rem **** title ****
  73. 651 poke53272,28
  74. 655 printchr$(147):poke53280,0:poke53281,0
  75. 660 print"<  joystick  tester  <"
  76. 665 print"written by michael smith"
  77. 670 print"press any key to start"
  78. 680 geta$:ifa$=""then680
  79. 690 return
  80. 700 end
  81.